package synctables

import (
	"fmt"

	"gitee.com/knowgo/gpa-examples/commands"
	"gitee.com/knowgo/gpa-examples/db/models"
	"gitee.com/knowgo/gpa-examples/examples/utils"
)

var Cmd = &commands.Command{
	Cmd:         "sync",
	Describtion: "同步表结构",
	EnterPoint: func(appName string, args []string) {
		e := utils.GetEngine()
		fmt.Println("正在同步表结构 ... ")
		if err := e.Sync(&models.Teacher{}, &models.Class{}, &models.Student{}); err != nil {
			panic(err)
		}
		fmt.Println("同步表结构完成")
	},
}
